package com.lnsystem.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.joda.time.DateTime;

@Entity
@Table(name="STOCKRATING")
public class StockRating {

	
	
	@Id
	@Column(name="ID")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="STOCK_RATING_SEQUENCE")
	@SequenceGenerator(
		    name="STOCK_RATING_SEQUENCE",
		    sequenceName="STOCK_RATING_SEQUENCE",
		    allocationSize=20
		)
	private Integer id;
	
	@Column(name="RANK")
	private String rank;
	
	@Column(name="COMPRATING")
	private Integer compRating;
	
	@Column(name="EPSRANK")
	private Integer EPSRank;

	@Column(name="RELST")
	 private Integer RelSt;
	
	@Column(name="GRPSTR")
	 private String grpStr;
	
	@Column(name="SMR")
	private String smr;
	
	@Column(name="ACCDIS")
	 private String accDis;
	
	@Column(name="SPONRATING")
	 private String sponRating;
	
	@Column(name="price")
	 private double price;
	
	@Column(name="PRICECLOSE")
	 private double priceClose;
	
	@Column(name="PRICECHANGE")
	 private double priceChange;
	
	@Column(name="VOLPERCHANGE") 
	private double volPerChange;
	
	@Column(name="DAILYVOL") 
	private double dailyVol;
	
	@Column(name="SPECIALCHAR")
	private String specialChar;
	
	@Column(name="WEEKHIGH52")
	private double weekHigh52;
	
	
	@Column(name="PEROFFHIGH")
	private double perOffHigh;
	
	@Column(name="PERATIO")
	private double pERatio;
	
	@Column(name="DIVYIELD")
	private double divYield;
	
	@Column(name="LASTQTRSALESPERCHG")
	private double LastQtrSalesPerChg;
	
	@Column(name="LASTQTREPSPERCHG")
	private double lastQtrEpsPerChg;
	
	@Column(name="CONSECQTREPSGRT15") 
	private Integer consecQtrEpsGrt15;
	
	@Column(name="CURQTREPSESTPERCHG") 
	private double curQtrEpsEstPerChg;
	
	@Column(name="CURYREPSESTPERCHG")
	private double curYrEpsEstPerChg;
	
	@Column(name="PRETAXMARGIN")
	private double pretaxMargin;
	
	@Column(name="ROE")
	private double ROE;
	
	@Column(name="MGMTOWNSPER")
	private Integer mgmtOwnsPer;
	
	@Column(name="QUOTEURL")
	private String quoteUrl;

	@Column(name="STOCKCHECKUPURL")
	private String stockCheckupUrl;
	
	@Column(name="MARKETSMITHURL") 
	private String marketsmithUrl;
	
	@Column(name="LEADERBOARDURL")
	private String leaderboardUrl;
	
	@Column(name="CHARTANALYSISURL") 
	private String chartAnalysisUrl;
	
	@Column(name="IBD100NEWENTRYFLAG") 
	private String ibd100NewEntryFlag;
	
	@Column(name="IBD100UPINRANKFLAG")
	private String ibd100UpInRankFlag;
	
	@Column(name="IBDBIGCAP20NEWENTRYFLAG")
	private String ibdBigCap20NewEntryFlag;
	
	@Column(name="COMPDESC")
	private String compDesc;

	@Column(name="SYMBOL")
	private String symbol;
	
	@Column(name="LASTUPDATEON")
	private Date lastUpdateOn;
	
	@OneToOne(fetch = FetchType.LAZY,  cascade = {CascadeType.ALL})
	@JoinColumn(name = "STOCKID", nullable = false) 
	private Stock stockId;
	
	
	@Transient
	private String healthString;
	
	
	
	public String getHealthString() {
		return healthString;
	}

	public void setHealthString(String healthString) {
		this.healthString = healthString;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getRank() {
		return rank;
	}

	public void setRank(String rank) {
		this.rank = rank;
	}

	public Integer getCompRating() {
		return compRating;
	}

	public void setCompRating(Integer compRating) {
		this.compRating = compRating;
	}

	public Integer getEPSRank() {
		return EPSRank;
	}

	public void setEPSRank(Integer ePSRank) {
		EPSRank = ePSRank;
	}

	public Integer getRelSt() {
		return RelSt;
	}

	public void setRelSt(Integer relSt) {
		RelSt = relSt;
	}

	public String getGrpStr() {
		return grpStr;
	}

	public void setGrpStr(String grpStr) {
		this.grpStr = grpStr;
	}

	public String getSmr() {
		return smr;
	}

	public void setSmr(String smr) {
		this.smr = smr;
	}

	public String getAccDis() {
		return accDis;
	}

	public void setAccDis(String accDis) {
		this.accDis = accDis;
	}

	public String getSponRating() {
		return sponRating;
	}

	public void setSponRating(String sponRating) {
		this.sponRating = sponRating;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public double getPriceClose() {
		return priceClose;
	}

	public void setPriceClose(double priceClose) {
		this.priceClose = priceClose;
	}

	public double getPriceChange() {
		return priceChange;
	}

	public void setPriceChange(double priceChange) {
		this.priceChange = priceChange;
	}

	public double getVolPerChange() {
		return volPerChange;
	}

	public void setVolPerChange(double volPerChange) {
		this.volPerChange = volPerChange;
	}

	public double getDailyVol() {
		return dailyVol;
	}

	public void setDailyVol(double dailyVol) {
		this.dailyVol = dailyVol;
	}

	public String getSpecialChar() {
		return specialChar;
	}

	public void setSpecialChar(String specialChar) {
		this.specialChar = specialChar;
	}

	public double getWeekHigh52() {
		return weekHigh52;
	}

	public void setWeekHigh52(double weekHigh52) {
		this.weekHigh52 = weekHigh52;
	}

	public double getPerOffHigh() {
		return perOffHigh;
	}

	public void setPerOffHigh(double perOffHigh) {
		this.perOffHigh = perOffHigh;
	}

	public double getpERatio() {
		return pERatio;
	}

	public void setpERatio(double pERatio) {
		this.pERatio = pERatio;
	}

	public double getDivYield() {
		return divYield;
	}

	public void setDivYield(double divYield) {
		this.divYield = divYield;
	}

	public double getLastQtrSalesPerChg() {
		return LastQtrSalesPerChg;
	}

	public void setLastQtrSalesPerChg(double lastQtrSalesPerChg) {
		LastQtrSalesPerChg = lastQtrSalesPerChg;
	}

	public double getLastQtrEpsPerChg() {
		return lastQtrEpsPerChg;
	}

	public void setLastQtrEpsPerChg(double lastQtrEpsPerChg) {
		this.lastQtrEpsPerChg = lastQtrEpsPerChg;
	}

	public double getConsecQtrEpsGrt15() {
		return consecQtrEpsGrt15;
	}

	public void setConsecQtrEpsGrt15(Integer consecQtrEpsGrt15) {
		this.consecQtrEpsGrt15 = consecQtrEpsGrt15;
	}

	public double getCurQtrEpsEstPerChg() {
		return curQtrEpsEstPerChg;
	}

	public void setCurQtrEpsEstPerChg(double curQtrEpsEstPerChg) {
		this.curQtrEpsEstPerChg = curQtrEpsEstPerChg;
	}

	public double getCurYrEpsEstPerChg() {
		return curYrEpsEstPerChg;
	}

	public void setCurYrEpsEstPerChg(double curYrEpsEstPerChg) {
		this.curYrEpsEstPerChg = curYrEpsEstPerChg;
	}

	public double getPretaxMargin() {
		return pretaxMargin;
	}

	public void setPretaxMargin(double pretaxMargin) {
		this.pretaxMargin = pretaxMargin;
	}

	public double getROE() {
		return ROE;
	}

	public void setROE(double rOE) {
		ROE = rOE;
	}

	public Integer getMgmtOwnsPer() {
		return mgmtOwnsPer;
	}

	public void setMgmtOwnsPer(Integer mgmtOwnsPer) {
		this.mgmtOwnsPer = mgmtOwnsPer;
	}

	public String getQuoteUrl() {
		return quoteUrl;
	}

	public void setQuoteUrl(String quoteUrl) {
		this.quoteUrl = quoteUrl;
	}

	public String getStockCheckupUrl() {
		return stockCheckupUrl;
	}

	public void setStockCheckupUrl(String stockCheckupUrl) {
		this.stockCheckupUrl = stockCheckupUrl;
	}

	public String getMarketsmithUrl() {
		return marketsmithUrl;
	}

	public void setMarketsmithUrl(String marketsmithUrl) {
		this.marketsmithUrl = marketsmithUrl;
	}

	public String getLeaderboardUrl() {
		return leaderboardUrl;
	}

	public void setLeaderboardUrl(String leaderboardUrl) {
		this.leaderboardUrl = leaderboardUrl;
	}

	public String getChartAnalysisUrl() {
		return chartAnalysisUrl;
	}

	public void setChartAnalysisUrl(String chartAnalysisUrl) {
		this.chartAnalysisUrl = chartAnalysisUrl;
	}

	public String getIbd100NewEntryFlag() {
		return ibd100NewEntryFlag;
	}

	public void setIbd100NewEntryFlag(String ibd100NewEntryFlag) {
		this.ibd100NewEntryFlag = ibd100NewEntryFlag;
	}

	public String getIbd100UpInRankFlag() {
		return ibd100UpInRankFlag;
	}

	public void setIbd100UpInRankFlag(String ibd100UpInRankFlag) {
		this.ibd100UpInRankFlag = ibd100UpInRankFlag;
	}

	public String getIbdBigCap20NewEntryFlag() {
		return ibdBigCap20NewEntryFlag;
	}

	public void setIbdBigCap20NewEntryFlag(String ibdBigCap20NewEntryFlag) {
		this.ibdBigCap20NewEntryFlag = ibdBigCap20NewEntryFlag;
	}

	public String getCompDesc() {
		return compDesc;
	}

	public void setCompDesc(String compDesc) {
		this.compDesc = compDesc;
	}

	public String getSymbol() {
		return symbol;
	}

	public void setSymbol(String symbol) {
		this.symbol = symbol;
	}

	public Stock getStockId() {
		return stockId;
	}

	public void setStockId(Stock stockId) {
		this.stockId = stockId;
	}

	public Date getLastUpdateOn() {
		return lastUpdateOn;
	}

	public void setLastUpdateOn(Date lastUpdateOn) {
		this.lastUpdateOn = lastUpdateOn;
	}
	
}
